package com.cskaoyan.config;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.web.servlet.HandlerInterceptor;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @author stone
 * @date 2022/12/26 11:14
 */
//@Configuration
@ComponentScan("com.cskaoyan.controller")
@EnableWebMvc // mvc:annotation-driven
// 后面还会做一些和SpringMVC相关的配置 需要实现接口 WebMvcConfigurer，如果实现接口里的方法就是提供一些额外的配置信息
public class ServletConfiguration implements WebMvcConfigurer {
    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        registry.addResourceHandler("/**").addResourceLocations("/");
    }
}
